package cn.com.taiji.pos.entity;

import cn.com.taiji.entity.StringUUIDEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.github.dreamyoung.mprelation.EntityMapper;
import com.github.dreamyoung.mprelation.JoinColumn;
import com.github.dreamyoung.mprelation.ManyToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 消费细单
 * </p>
 *
 * @author
 * @since 2021-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TradeConsumptionDetail extends StringUUIDEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 所属消费主单
     */
    @TableField("MAIN_ID")
    private String mainId;

    /**
     * 消费菜品(系统中对象)
     */
    @TableField("FOOD_ID")
    private String foodId;
    @TableField(exist = false)
    @EntityMapper
    @ManyToOne
    @JoinColumn(name = "food_id", referencedColumnName = "id")
    private MenuFoodItem food;

    /**
     * 业务类型
     */
    @TableField("BUSINESS_TYPE_ID")
    private String businessTypeId;

    /**
     * 菜品原单价
     */
    @TableField("PRICE")
    private BigDecimal price;

    @TableField("QUANTITY")
    private Double quantity;

    /**
     * 实际总额(打折后)
     */
    @TableField("ACTUAL_AMOUNT")
    private BigDecimal actualAmount;

    /**
     * 人工折扣(前台输入)
     */
    @TableField("HAND_DISCOUNT")
    private BigDecimal handDiscount;

    /**
     * 折扣原因
     */
    @TableField("REASON_ID")
    private String reasonId;

    /**
     * 是否导出xml(0:否1:是)
     */
    @TableField("XML_OUT")
    private String xmlOut;

    /**
     * 是否退款(0:否1:是2:审批中)
     */
    @TableField("REFUND_STATUS")
    private String refundStatus = "0";

    /**
     * 是否已经生成销售单
     */
    @TableField("IS_CREATE_INVENTORY")
    private Boolean isCreateInventory = false;


}
